import request from '@/utils/request'

//首页数据
export function getIndex() {
    return request.get({ url: '/index/index' })
}

// 装修页面
export function getDecorate(data: any) {
    return request.get({ url: '/index/decorate', data }, { ignoreCancel: true })
}

/**
 * @description 热门搜索
 * @return { Promise }
 */
export function getHotSearch() {
    return request.get({ url: '/search/hotLists' })
}


/**
 * @description 课程分类
 * @return { Promise }
 */
export function courseType() {
    return request.get({ url: '/index/course_type' }, { ignoreCancel: true })
}

// 课程列表
export function getCourse(data: any) {
    return request.get({ url: '/index/course', data }, { ignoreCancel: true })
}

// 课程详情
export function courseDetail(data?: any) {
    return request.get({ url: '/index/course_detail', data }, { ignoreCancel: true })
}

//播放进度
export function courseLearning(data: any) {
    return request.post({ url: '/index/course_learning', data }, { isAuth: true })
}

// 学习记录
export function courseList(data?: any) {
    return request.get({ url: '/index/course_learning_list', data }, { ignoreCancel: true })
}

//反馈建议
export function fankui(data: any) {
    return request.post({ url: '/index/fankui', data }, { isAuth: true })
}
